
package com.english.service.impl;

import java.util.List;

import com.english.service.impl.BaseManager;
import com.english.model.Type;
import com.english.dao.TypeDao;
import com.english.service.TypeManager;

public class TypeManagerImpl extends BaseManager implements TypeManager {
    private TypeDao dao;

    /**
     * Set the Dao for communication with the data layer.
     * @param dao
     */
    public void setTypeDao(TypeDao dao) {
        this.dao = dao;
    }

    /**
     * @see com.english.service.TypeManager#getTypes(com.english.model.Type)
     */
    public List getTypes(final Type type) {
        return dao.getTypes(type);
    }

    /**
     * @see com.english.service.TypeManager#getType(String id)
     */
    public Type getType(final String id) {
        return dao.getType(new Long(id));
    }

    /**
     * @see com.english.service.TypeManager#saveType(Type type)
     */
    public void saveType(Type type) {
        dao.saveType(type);
    }

    /**
     * @see com.english.service.TypeManager#removeType(String id)
     */
    public void removeType(final String id) {
        dao.removeType(new Long(id));
    }
}
